//
//  LCSwipeCellScrollView.m
//  LCLibrary
//
//  Created by cc on 14-11-5.
//  Copyright (c) 2014年 cc. All rights reserved.
//

#import "LCSwipeCellScrollView.h"

@implementation LCSwipeCellScrollView
/**
 *  检查当前滑动手势是否允许响应
 *
 *  @param gestureRecognizer
 *
 *  @return
 */
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
    if (gestureRecognizer == self.panGestureRecognizer)
    {
        //左右滑动返回YES，上下滑动返回NO
        CGPoint translation = [(UIPanGestureRecognizer*)gestureRecognizer translationInView:gestureRecognizer.view];
        BOOL allowGesture = fabs(translation.y) <= fabs(translation.x);
        return allowGesture;
    }
    return YES;
}
@end
